<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>将类数组转换为数组</title>
</head>
<body>
  <script>
    let arr = {
      '0':1,
      '1':2,
      '2':3,
      length:3
    }
    let arr1 = Array.from(arr);
    console.log(...arr1);//1 2 3
    //可以在后面添加一个参数 用于对数据的处理
    let arr2 = Array.from(arr,item => item * 2);
    console.log(...arr2);
  </script>
</body>
</html>